<template>
  <div>父组件 - {{ count }} - <button @click="count++">count++</button></div>
  <Child :count="count" @abc="fn" />
</template>

<!-- <script>
import Child from "./componentsChild1.vue";
export default {
  setup() {},
  // 如果用setup函数的写法，components选项还是要有的
  components: {
    Child,
  },
};
</script> -->

<script setup>
import { ref } from "vue";
import Child from "./componentsChild1.vue";

const count = ref(1);

const fn = (n) => {
  console.log("fn", n);
};
</script>
